package com.neucollege.system.handler;

import com.neucollege.system.exception.UserNotLoginExecption;
import com.neucollege.system.result.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class NPOSystemExceptionHandler{
    @ExceptionHandler(UserNotLoginExecption.class)
    public Result handleUserNotLoginException(UserNotLoginExecption e){
        System.out.println(e.getMessage());
        return Result.notLogin(e.getMessage());
    }
}
